Do the usual things: check the log.nsf file / run the agent with the Java console open, etc. You need to see what the errors are before continuing down this route -- for example, maniupating the file system on a server is a restricted operation in Notes (understandably) and this will have an impact on any Java code like this that you may wish to schedule.
--
http://www.benpoole.com